import {axiosLogin} from '../index'
//获取动态参数和静态属性数据
export function getParams(id,sel){
    return axiosLogin({
        url:`/categories/${id}/attributes`,
        method:'get',
        params:{
            id,
            sel
        }
    })
}
//添加动态参数和静态属性数据
export function setParamsList(id,attr_name,attr_sel,attr_vals){
    return axiosLogin({
        url:`categories/${id}/attributes`,
        method:'post',
        data:{
            id,
            attr_name,
            attr_sel,
            attr_vals
        }
    })
}
//根据id 查出要修改的数据
export function getParamsIdList(id,attrId,attr_sel){
    return axiosLogin({
        url:`categories/${id}/attributes/${attrId}`,
        method:'get',
        params:{
            id,
            attrId,
            attr_sel
        }
    })
}
//编辑提交数据接口
export function setParamsName(id,attrId,attr_name,attr_sel,attr_vals){
    return axiosLogin({
        url:`categories/${id}/attributes/${attrId}`,
        method:'put',
        data:{
            id,
            attrId,
            attr_name,
            attr_sel,
            attr_vals
        }
    })
}
//删除参数数据接口
export function delParams(id,attrid){
    return axiosLogin({
        url:`categories/${id}/attributes/${attrid}`,
        method:'delete',
    })
}